home *** CD-ROM | disk | FTP | other *** search
/ funcom 2000 Presskit / 000721_1312 (fun.com).iso / funcom.dir / 00023_Script_Slider Track behavior < prev    next >
Text File  |  2000-07-20  |  841b  |  31 lines

  1.  
  2.  
  3. -- Slider Track behavior
  4.  
  5. -----------------------------------------------------------
  6. -- This behavior tells the slider behavior when you have 
  7. -- clicked the track and the stage location where you
  8. -- clicked.
  9. --
  10. -- You attach this behavior to a sprite representing a
  11. -- track.
  12. --
  13. -- David Benman 11/97
  14. -----------------------------------------------------------
  15.  
  16.  
  17. on mouseDown me
  18.   set currentSprite to the spriteNum of me
  19.   set trackWidth to the width of sprite currentSprite
  20.   set trackHeight to the height of sprite currentSprite
  21.   
  22.   -- Sends the horizontal or vertical mouse location to the
  23.   -- slider behavior.
  24.   if trackWidth > trackHeight then
  25.     set newPosition to the mouseH
  26.   else
  27.     set newPosition to the mouseV
  28.   end if
  29.   sendSprite(the spriteNum of me + 1, #slideButton, newPosition)
  30.   
  31. end